package caddey.jonathan.gameframeworkandroidimplementation;

import framework.GraphicsWrapper;
import framework.ImageWrapper;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;

public class AndroidImage implements ImageWrapper {
    private final Bitmap my_bitmap;
   
    public AndroidImage(Bitmap the_bitmap) {
        my_bitmap = the_bitmap;
    }

    public AndroidImage(final int the_width, final int the_height) {
		my_bitmap = Bitmap.createBitmap(the_width, the_height, Bitmap.Config.ARGB_8888);
	}

	@Override
    public int getWidth() {
        return my_bitmap.getWidth();
    }

    @Override
    public int getHeight() {
        return my_bitmap.getHeight();
    }
    
    @Override
    public GraphicsWrapper getGraphics() {
    	return new AndroidGraphics(my_bitmap);
    }
    
    @Override
    public void dispose() {
        my_bitmap.recycle();
    } 
    
    public Bitmap getBitmap() {
    	return my_bitmap;
    }
}
